<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input
          v-model="queryParams.deptId"
          placeholder="请输入部门ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门" prop="department">
        <el-select v-model="queryParams.department" placeholder="请选择部门" clearable>
          <el-option
            v-for="dict in dict.type.yqg_department"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="用户昵称" prop="nickName">
        <el-input
          v-model="queryParams.nickName"
          placeholder="请输入用户昵称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户账号" prop="userName">
        <el-input
          v-model="queryParams.userName"
          placeholder="请输入用户账号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="职务" prop="post">
        <el-select v-model="queryParams.post" placeholder="请选择职务" clearable>
          <el-option
            v-for="dict in dict.type.yqg_post"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="手牌号" prop="handBrand">
        <el-input
          v-model="queryParams.handBrand"
          placeholder="请输入手牌号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="手牌类别" prop="handCategory">
        <el-select v-model="queryParams.handCategory" placeholder="请选择手牌类别" clearable>
          <el-option
            v-for="dict in dict.type.yqg_hand_category"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="手牌状态" prop="handState">
        <el-select v-model="queryParams.handState" placeholder="请选择手牌状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_hand_state"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="留牌状态" prop="retentionStatus">
        <el-select v-model="queryParams.retentionStatus" placeholder="请选择留牌状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_retention_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="并牌状态" prop="mergeStatus">
        <el-select v-model="queryParams.mergeStatus" placeholder="请选择并牌状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_merge_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="入店时间" prop="openingTime">
        <el-date-picker clearable
          v-model="queryParams.openingTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择入店时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="并牌时间" prop="drawTime">
        <el-date-picker clearable
          v-model="queryParams.drawTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择并牌时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="并牌手牌" prop="mergeHands">
        <el-input
          v-model="queryParams.mergeHands"
          placeholder="请输入并牌手牌"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="并牌吧台账号ID" prop="mergeBarBillsId">
        <el-input
          v-model="queryParams.mergeBarBillsId"
          placeholder="请输入并牌吧台账号ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="留牌时间" prop="leaveTime">
        <el-date-picker clearable
          v-model="queryParams.leaveTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择留牌时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="留前手牌" prop="beforeLeave">
        <el-input
          v-model="queryParams.beforeLeave"
          placeholder="请输入留前手牌"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="留前吧台ID" prop="beforeBarBillsId">
        <el-input
          v-model="queryParams.beforeBarBillsId"
          placeholder="请输入留前吧台ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="entryName">
        <el-input
          v-model="queryParams.entryName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目类别" prop="projectCategory">
        <el-select v-model="queryParams.projectCategory" placeholder="请选择项目类别" clearable>
          <el-option
            v-for="dict in dict.type.yqg_project_category"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="项目代码" prop="projectCode">
        <el-input
          v-model="queryParams.projectCode"
          placeholder="请输入项目代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="助记码" prop="mnemonicCode">
        <el-input
          v-model="queryParams.mnemonicCode"
          placeholder="请输入助记码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单位" prop="unit">
        <el-input
          v-model="queryParams.unit"
          placeholder="请输入单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单价" prop="unitPrice">
        <el-input
          v-model="queryParams.unitPrice"
          placeholder="请输入单价"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="提成价" prop="commissionPrice">
        <el-input
          v-model="queryParams.commissionPrice"
          placeholder="请输入提成价"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="同来" prop="together">
        <el-input
          v-model="queryParams.together"
          placeholder="请输入同来"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="班次标志" prop="sailingsSigns">
        <el-select v-model="queryParams.sailingsSigns" placeholder="请选择班次标志" clearable>
          <el-option
            v-for="dict in dict.type.yqg_sailings_signs"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="吧台账单ID" prop="barBillsId">
        <el-input
          v-model="queryParams.barBillsId"
          placeholder="请输入吧台账单ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="录单时间" prop="recordingTime">
        <el-date-picker clearable
          v-model="queryParams.recordingTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择录单时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="数量" prop="quantity">
        <el-input
          v-model="queryParams.quantity"
          placeholder="请输入数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合计金额" prop="totalAmount">
        <el-input
          v-model="queryParams.totalAmount"
          placeholder="请输入合计金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="位置" prop="seat">
        <el-input
          v-model="queryParams.seat"
          placeholder="请输入位置"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="点餐单号" prop="orderNumber">
        <el-input
          v-model="queryParams.orderNumber"
          placeholder="请输入点餐单号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="付款方式" prop="paymentMethod">
        <el-select v-model="queryParams.paymentMethod" placeholder="请选择付款方式" clearable>
          <el-option
            v-for="dict in dict.type.yqg_payment_method"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="消费状态" prop="consumptionStatus">
        <el-select v-model="queryParams.consumptionStatus" placeholder="请选择消费状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_consumption_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="退单时间" prop="chargebackTime">
        <el-date-picker clearable
          v-model="queryParams.chargebackTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择退单时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="退单原因" prop="reasonForChargeback">
        <el-input
          v-model="queryParams.reasonForChargeback"
          placeholder="请输入退单原因"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="退单处理人账号" prop="chargebackProcessorAccount">
        <el-input
          v-model="queryParams.chargebackProcessorAccount"
          placeholder="请输入退单处理人账号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="退单处理人姓名" prop="chargebackProcessorName">
        <el-input
          v-model="queryParams.chargebackProcessorName"
          placeholder="请输入退单处理人姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="上钟时间" prop="clockTime">
        <el-date-picker clearable
          v-model="queryParams.clockTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择上钟时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="下钟时间" prop="nextClockTime">
        <el-date-picker clearable
          v-model="queryParams.nextClockTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择下钟时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="下钟状态" prop="nextClockStatus">
        <el-select v-model="queryParams.nextClockStatus" placeholder="请选择下钟状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_next_clock_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="录单员工号" prop="recordEmployeeNumber">
        <el-input
          v-model="queryParams.recordEmployeeNumber"
          placeholder="请输入录单员工号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="录单员姓名" prop="recorderEmployeeName">
        <el-input
          v-model="queryParams.recorderEmployeeName"
          placeholder="请输入录单员姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="开房时间" prop="openingHours">
        <el-date-picker clearable
          v-model="queryParams.openingHours"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择开房时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="退房时间" prop="checkOutTime">
        <el-date-picker clearable
          v-model="queryParams.checkOutTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择退房时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="退房状态" prop="checkOutStatus">
        <el-select v-model="queryParams.checkOutStatus" placeholder="请选择退房状态" clearable>
          <el-option
            v-for="dict in dict.type.yqg_check_out_status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="备注1" prop="note1">
        <el-input
          v-model="queryParams.note1"
          placeholder="请输入备注1"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注2" prop="note2">
        <el-input
          v-model="queryParams.note2"
          placeholder="请输入备注2"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注3" prop="note3">
        <el-input
          v-model="queryParams.note3"
          placeholder="请输入备注3"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注4" prop="note4">
        <el-input
          v-model="queryParams.note4"
          placeholder="请输入备注4"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注5" prop="note5">
        <el-input
          v-model="queryParams.note5"
          placeholder="请输入备注5"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注6" prop="note6">
        <el-input
          v-model="queryParams.note6"
          placeholder="请输入备注6"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注7" prop="note7">
        <el-input
          v-model="queryParams.note7"
          placeholder="请输入备注7"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注8" prop="note8">
        <el-input
          v-model="queryParams.note8"
          placeholder="请输入备注8"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注9" prop="note9">
        <el-input
          v-model="queryParams.note9"
          placeholder="请输入备注9"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注10" prop="note10">
        <el-input
          v-model="queryParams.note10"
          placeholder="请输入备注10"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['project:details:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['project:details:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['project:details:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['project:details:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="detailsList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="id" align="center" prop="ID" />
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="部门" align="center" prop="department">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_department" :value="scope.row.department"/>
        </template>
      </el-table-column>
      <el-table-column label="用户昵称" align="center" prop="nickName" />
      <el-table-column label="用户账号" align="center" prop="userName" />
      <el-table-column label="职务" align="center" prop="post">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_post" :value="scope.row.post"/>
        </template>
      </el-table-column>
      <el-table-column label="手牌号" align="center" prop="handBrand" />
      <el-table-column label="手牌类别" align="center" prop="handCategory">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_hand_category" :value="scope.row.handCategory"/>
        </template>
      </el-table-column>
      <el-table-column label="手牌状态" align="center" prop="handState">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_hand_state" :value="scope.row.handState"/>
        </template>
      </el-table-column>
      <el-table-column label="留牌状态" align="center" prop="retentionStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_retention_status" :value="scope.row.retentionStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="并牌状态" align="center" prop="mergeStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_merge_status" :value="scope.row.mergeStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="入店时间" align="center" prop="openingTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.openingTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="并牌时间" align="center" prop="drawTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.drawTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="并牌手牌" align="center" prop="mergeHands" />
      <el-table-column label="并牌吧台账号ID" align="center" prop="mergeBarBillsId" />
      <el-table-column label="留牌时间" align="center" prop="leaveTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.leaveTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="留前手牌" align="center" prop="beforeLeave" />
      <el-table-column label="留前吧台ID" align="center" prop="beforeBarBillsId" />
      <el-table-column label="项目名称" align="center" prop="entryName" />
      <el-table-column label="项目类别" align="center" prop="projectCategory">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_project_category" :value="scope.row.projectCategory"/>
        </template>
      </el-table-column>
      <el-table-column label="项目代码" align="center" prop="projectCode" />
      <el-table-column label="助记码" align="center" prop="mnemonicCode" />
      <el-table-column label="单位" align="center" prop="unit" />
      <el-table-column label="单价" align="center" prop="unitPrice" />
      <el-table-column label="提成价" align="center" prop="commissionPrice" />
      <el-table-column label="同来" align="center" prop="together" />
      <el-table-column label="班次标志" align="center" prop="sailingsSigns">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_sailings_signs" :value="scope.row.sailingsSigns"/>
        </template>
      </el-table-column>
      <el-table-column label="吧台账单ID" align="center" prop="barBillsId" />
      <el-table-column label="录单时间" align="center" prop="recordingTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.recordingTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="数量" align="center" prop="quantity" />
      <el-table-column label="合计金额" align="center" prop="totalAmount" />
      <el-table-column label="位置" align="center" prop="seat" />
      <el-table-column label="点餐单号" align="center" prop="orderNumber" />
      <el-table-column label="付款方式" align="center" prop="paymentMethod">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_payment_method" :value="scope.row.paymentMethod"/>
        </template>
      </el-table-column>
      <el-table-column label="消费状态" align="center" prop="consumptionStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_consumption_status" :value="scope.row.consumptionStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="退单时间" align="center" prop="chargebackTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.chargebackTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="退单原因" align="center" prop="reasonForChargeback" />
      <el-table-column label="退单处理人账号" align="center" prop="chargebackProcessorAccount" />
      <el-table-column label="退单处理人姓名" align="center" prop="chargebackProcessorName" />
      <el-table-column label="上钟时间" align="center" prop="clockTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.clockTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="下钟时间" align="center" prop="nextClockTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.nextClockTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="下钟状态" align="center" prop="nextClockStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_next_clock_status" :value="scope.row.nextClockStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="录单员工号" align="center" prop="recordEmployeeNumber" />
      <el-table-column label="录单员姓名" align="center" prop="recorderEmployeeName" />
      <el-table-column label="房间类型" align="center" prop="roomType" />
      <el-table-column label="开房时间" align="center" prop="openingHours" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.openingHours, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="退房时间" align="center" prop="checkOutTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.checkOutTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="退房状态" align="center" prop="checkOutStatus">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.yqg_check_out_status" :value="scope.row.checkOutStatus"/>
        </template>
      </el-table-column>
      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注7" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['project:details:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['project:details:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改消费详细对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>
        <el-form-item label="部门" prop="department">
          <el-select v-model="form.department" placeholder="请选择部门">
            <el-option
              v-for="dict in dict.type.yqg_department"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="用户昵称" prop="nickName">
          <el-input v-model="form.nickName" placeholder="请输入用户昵称" />
        </el-form-item>
        <el-form-item label="用户账号" prop="userName">
          <el-input v-model="form.userName" placeholder="请输入用户账号" />
        </el-form-item>
        <el-form-item label="职务" prop="post">
          <el-select v-model="form.post" placeholder="请选择职务">
            <el-option
              v-for="dict in dict.type.yqg_post"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="手牌号" prop="handBrand">
          <el-input v-model="form.handBrand" placeholder="请输入手牌号" />
        </el-form-item>
        <el-form-item label="手牌类别" prop="handCategory">
          <el-select v-model="form.handCategory" placeholder="请选择手牌类别">
            <el-option
              v-for="dict in dict.type.yqg_hand_category"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="手牌状态" prop="handState">
          <el-select v-model="form.handState" placeholder="请选择手牌状态">
            <el-option
              v-for="dict in dict.type.yqg_hand_state"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="留牌状态" prop="retentionStatus">
          <el-select v-model="form.retentionStatus" placeholder="请选择留牌状态">
            <el-option
              v-for="dict in dict.type.yqg_retention_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="并牌状态" prop="mergeStatus">
          <el-select v-model="form.mergeStatus" placeholder="请选择并牌状态">
            <el-option
              v-for="dict in dict.type.yqg_merge_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="入店时间" prop="openingTime">
          <el-date-picker clearable
            v-model="form.openingTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择入店时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="并牌时间" prop="drawTime">
          <el-date-picker clearable
            v-model="form.drawTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择并牌时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="并牌手牌" prop="mergeHands">
          <el-input v-model="form.mergeHands" placeholder="请输入并牌手牌" />
        </el-form-item>
        <el-form-item label="并牌吧台账号ID" prop="mergeBarBillsId">
          <el-input v-model="form.mergeBarBillsId" placeholder="请输入并牌吧台账号ID" />
        </el-form-item>
        <el-form-item label="留牌时间" prop="leaveTime">
          <el-date-picker clearable
            v-model="form.leaveTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择留牌时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="留前手牌" prop="beforeLeave">
          <el-input v-model="form.beforeLeave" placeholder="请输入留前手牌" />
        </el-form-item>
        <el-form-item label="留前吧台ID" prop="beforeBarBillsId">
          <el-input v-model="form.beforeBarBillsId" placeholder="请输入留前吧台ID" />
        </el-form-item>
        <el-form-item label="项目名称" prop="entryName">
          <el-input v-model="form.entryName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="项目类别" prop="projectCategory">
          <el-select v-model="form.projectCategory" placeholder="请选择项目类别">
            <el-option
              v-for="dict in dict.type.yqg_project_category"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="项目代码" prop="projectCode">
          <el-input v-model="form.projectCode" placeholder="请输入项目代码" />
        </el-form-item>
        <el-form-item label="助记码" prop="mnemonicCode">
          <el-input v-model="form.mnemonicCode" placeholder="请输入助记码" />
        </el-form-item>
        <el-form-item label="单位" prop="unit">
          <el-input v-model="form.unit" placeholder="请输入单位" />
        </el-form-item>
        <el-form-item label="单价" prop="unitPrice">
          <el-input v-model="form.unitPrice" placeholder="请输入单价" />
        </el-form-item>
        <el-form-item label="提成价" prop="commissionPrice">
          <el-input v-model="form.commissionPrice" placeholder="请输入提成价" />
        </el-form-item>
        <el-form-item label="同来" prop="together">
          <el-input v-model="form.together" placeholder="请输入同来" />
        </el-form-item>
        <el-form-item label="班次标志" prop="sailingsSigns">
          <el-select v-model="form.sailingsSigns" placeholder="请选择班次标志">
            <el-option
              v-for="dict in dict.type.yqg_sailings_signs"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="吧台账单ID" prop="barBillsId">
          <el-input v-model="form.barBillsId" placeholder="请输入吧台账单ID" />
        </el-form-item>
        <el-form-item label="录单时间" prop="recordingTime">
          <el-date-picker clearable
            v-model="form.recordingTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择录单时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="数量" prop="quantity">
          <el-input v-model="form.quantity" placeholder="请输入数量" />
        </el-form-item>
        <el-form-item label="合计金额" prop="totalAmount">
          <el-input v-model="form.totalAmount" placeholder="请输入合计金额" />
        </el-form-item>
        <el-form-item label="位置" prop="seat">
          <el-input v-model="form.seat" placeholder="请输入位置" />
        </el-form-item>
        <el-form-item label="点餐单号" prop="orderNumber">
          <el-input v-model="form.orderNumber" placeholder="请输入点餐单号" />
        </el-form-item>
        <el-form-item label="付款方式" prop="paymentMethod">
          <el-select v-model="form.paymentMethod" placeholder="请选择付款方式">
            <el-option
              v-for="dict in dict.type.yqg_payment_method"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="消费状态" prop="consumptionStatus">
          <el-select v-model="form.consumptionStatus" placeholder="请选择消费状态">
            <el-option
              v-for="dict in dict.type.yqg_consumption_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="退单时间" prop="chargebackTime">
          <el-date-picker clearable
            v-model="form.chargebackTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择退单时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="退单原因" prop="reasonForChargeback">
          <el-input v-model="form.reasonForChargeback" placeholder="请输入退单原因" />
        </el-form-item>
        <el-form-item label="退单处理人账号" prop="chargebackProcessorAccount">
          <el-input v-model="form.chargebackProcessorAccount" placeholder="请输入退单处理人账号" />
        </el-form-item>
        <el-form-item label="退单处理人姓名" prop="chargebackProcessorName">
          <el-input v-model="form.chargebackProcessorName" placeholder="请输入退单处理人姓名" />
        </el-form-item>
        <el-form-item label="上钟时间" prop="clockTime">
          <el-date-picker clearable
            v-model="form.clockTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择上钟时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="下钟时间" prop="nextClockTime">
          <el-date-picker clearable
            v-model="form.nextClockTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择下钟时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="下钟状态" prop="nextClockStatus">
          <el-select v-model="form.nextClockStatus" placeholder="请选择下钟状态">
            <el-option
              v-for="dict in dict.type.yqg_next_clock_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="录单员工号" prop="recordEmployeeNumber">
          <el-input v-model="form.recordEmployeeNumber" placeholder="请输入录单员工号" />
        </el-form-item>
        <el-form-item label="录单员姓名" prop="recorderEmployeeName">
          <el-input v-model="form.recorderEmployeeName" placeholder="请输入录单员姓名" />
        </el-form-item>
        <el-form-item label="开房时间" prop="openingHours">
          <el-date-picker clearable
            v-model="form.openingHours"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择开房时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="退房时间" prop="checkOutTime">
          <el-date-picker clearable
            v-model="form.checkOutTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择退房时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="退房状态" prop="checkOutStatus">
          <el-select v-model="form.checkOutStatus" placeholder="请选择退房状态">
            <el-option
              v-for="dict in dict.type.yqg_check_out_status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="备注1" prop="note1">
          <el-input v-model="form.note1" placeholder="请输入备注1" />
        </el-form-item>
        <el-form-item label="备注2" prop="note2">
          <el-input v-model="form.note2" placeholder="请输入备注2" />
        </el-form-item>
        <el-form-item label="备注3" prop="note3">
          <el-input v-model="form.note3" placeholder="请输入备注3" />
        </el-form-item>
        <el-form-item label="备注4" prop="note4">
          <el-input v-model="form.note4" placeholder="请输入备注4" />
        </el-form-item>
        <el-form-item label="备注5" prop="note5">
          <el-input v-model="form.note5" placeholder="请输入备注5" />
        </el-form-item>
        <el-form-item label="备注6" prop="note6">
          <el-input v-model="form.note6" placeholder="请输入备注6" />
        </el-form-item>
        <el-form-item label="备注7" prop="note7">
          <el-input v-model="form.note7" placeholder="请输入备注7" />
        </el-form-item>
        <el-form-item label="备注8" prop="note8">
          <el-input v-model="form.note8" placeholder="请输入备注8" />
        </el-form-item>
        <el-form-item label="备注9" prop="note9">
          <el-input v-model="form.note9" placeholder="请输入备注9" />
        </el-form-item>
        <el-form-item label="备注10" prop="note10">
          <el-input v-model="form.note10" placeholder="请输入备注10" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listDetails, getDetails, delDetails, addDetails, updateDetails } from "@/api/project/details";

export default {
  name: "Details",
  dicts: ['yqg_hand_category', 'yqg_hand_state', 'yqg_payment_method', 'yqg_consumption_status', 'yqg_retention_status', 'yqg_project_category', 'yqg_post', 'yqg_check_out_status', 'yqg_department', 'yqg_merge_status', 'yqg_sailings_signs', 'yqg_next_clock_status'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 消费详细表格数据
      detailsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        deptId: null,
        department: null,
        nickName: null,
        userName: null,
        post: null,
        handBrand: null,
        handCategory: null,
        handState: null,
        retentionStatus: null,
        mergeStatus: null,
        openingTime: null,
        drawTime: null,
        mergeHands: null,
        mergeBarBillsId: null,
        leaveTime: null,
        beforeLeave: null,
        beforeBarBillsId: null,
        entryName: null,
        projectCategory: null,
        projectCode: null,
        mnemonicCode: null,
        unit: null,
        unitPrice: null,
        commissionPrice: null,
        together: null,
        sailingsSigns: null,
        barBillsId: null,
        recordingTime: null,
        quantity: null,
        totalAmount: null,
        seat: null,
        orderNumber: null,
        paymentMethod: null,
        consumptionStatus: null,
        chargebackTime: null,
        reasonForChargeback: null,
        chargebackProcessorAccount: null,
        chargebackProcessorName: null,
        clockTime: null,
        nextClockTime: null,
        nextClockStatus: null,
        recordEmployeeNumber: null,
        recorderEmployeeName: null,
        roomType: null,
        openingHours: null,
        checkOutTime: null,
        checkOutStatus: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询消费详细列表 */
    getList() {
      this.loading = true;
      listDetails(this.queryParams).then(response => {
        this.detailsList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        ID: null,
        userId: null,
        deptId: null,
        department: null,
        nickName: null,
        userName: null,
        post: null,
        handBrand: null,
        handCategory: null,
        handState: null,
        retentionStatus: null,
        mergeStatus: null,
        openingTime: null,
        drawTime: null,
        mergeHands: null,
        mergeBarBillsId: null,
        leaveTime: null,
        beforeLeave: null,
        beforeBarBillsId: null,
        entryName: null,
        projectCategory: null,
        projectCode: null,
        mnemonicCode: null,
        unit: null,
        unitPrice: null,
        commissionPrice: null,
        together: null,
        sailingsSigns: null,
        barBillsId: null,
        recordingTime: null,
        quantity: null,
        totalAmount: null,
        seat: null,
        orderNumber: null,
        paymentMethod: null,
        consumptionStatus: null,
        chargebackTime: null,
        reasonForChargeback: null,
        chargebackProcessorAccount: null,
        chargebackProcessorName: null,
        clockTime: null,
        nextClockTime: null,
        nextClockStatus: null,
        recordEmployeeNumber: null,
        recorderEmployeeName: null,
        roomType: null,
        openingHours: null,
        checkOutTime: null,
        checkOutStatus: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.ID)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加消费详细";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const ID = row.ID || this.ids
      getDetails(ID).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改消费详细";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.ID != null) {
            updateDetails(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDetails(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const IDs = row.ID || this.ids;
      this.$modal.confirm('是否确认删除消费详细编号为"' + IDs + '"的数据项？').then(function() {
        return delDetails(IDs);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('project/details/export', {
        ...this.queryParams
      }, `details_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
